From 26f1a8bbbb7662b4f2523dce5fd2b6fb99664a6f Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Thu, 12 Feb 2004 14:08:27 +0000 Subject: [PATCH] bitkeeper revision 1.719.1.1 (402b88dbPFLq-2M3bwI8UKm_GsCkQw) process.c, Rules.mk: Fix bug when context-switching LDT in Xenolinux. --- xen/arch/i386/Rules.mk | 4 ++-- xenolinux-2.4.24-sparse/arch/xeno/kernel/process.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xen/arch/i386/Rules.mk b/xen/arch/i386/Rules.mk index 7adf28664d..56f5932b6d 100644 --- a/xen/arch/i386/Rules.mk +++ b/xen/arch/i386/Rules.mk @@ -9,8 +9,8 @@ MONITOR_BASE := 0xFC500000 LOAD_BASE := 0x00100000 CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing CFLAGS += -iwithprefix include -O3 -Wall -DMONITOR_BASE=$(MONITOR_BASE) -#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG -CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ +CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG +#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ CFLAGS += -Wno-pointer-arith -Wredundant-decls LDFLAGS := -T xeno.lds -N diff --git a/xenolinux-2.4.24-sparse/arch/xeno/kernel/process.c b/xenolinux-2.4.24-sparse/arch/xeno/kernel/process.c index 78820a8b15..d57c6ba2dc 100644 --- a/xenolinux-2.4.24-sparse/arch/xeno/kernel/process.c +++ b/xenolinux-2.4.24-sparse/arch/xeno/kernel/process.c @@ -371,6 +371,15 @@ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p) __cli(); + /* + * We clobber FS and GS here so that we avoid a GPF when restoring previous + * task's FS/GS values in Xen when the LDT is switched. If we don't do this + * then we can end up erroneously re-flushing the page-update queue when + * we 'execute_multicall_list'. + */ + __asm__ __volatile__ ( + "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs" : : : "eax" ); + MULTICALL_flush_page_update_queue(); /* -- 2.30.2